package com.dmap.knowledge.service;

import com.dmap.knowledge.cache.po.HotArticleCachePo;
import com.dmap.knowledge.cache.po.TodayArticleCachePo;
import com.dmap.knowledge.controller.api.param.ArticleMockParam;
import com.dmap.knowledge.vo.ArticleDetailVo;
import com.dmap.knowledge.vo.ArticleLinkVo;
import com.dmap.knowledge.vo.ArticleTotalityInfoVo;
import com.dmap.knowledge.vo.ArticleVo;

import java.util.List;

/**
 * @Author zmh
 * @date 18-7-18 下午7:23
 */
public interface ArticleExtensionService {
    /**
     * 后台查找articleList
     *
     * @param companyNumber
     * @param appNumber
     * @param lang
     * @param columnId
     * @param key
     * @param order
     * @param pageIndex
     * @param pageSize
     * @return
     */
    public List<ArticleVo> selectArticleList(String companyNumber, String appNumber, String lang, String columnId, String key, long order, int pageIndex, int pageSize);
    
    /**
     * 统计后台的文章列表数量
     *
     * @param companyNumber
     * @param appNumber
     * @param lang
     * @param columnId
     * @param key
     * @param order
     * @return
     */
    public int countArticleList(String companyNumber, String appNumber, String lang, String columnId, String key, long order);
    
    
    
    
    /**
     * 查看文章的内部链接
     *
     * @param companyNumber
     * @param appNumber
     * @param lang
     * @param columnId
     * @param database
     * @param pageIndex
     * @param pageSize
     * @return
     */
    List<ArticleLinkVo> selectArticleLinkList(String companyNumber, String appNumber, String lang, String columnId, int database, int pageIndex, int pageSize);
    
    /**
     * 文章的内部连接数量
     *
     * @param companyNumber
     * @param appNumber
     * @param lang
     * @param columnId
     * @param database
     * @return
     */
    int countArticleLinkList(String companyNumber, String appNumber, String lang, String columnId, int database);
    
    /**
     * 更新文章的阅读量
     *
     * @param articleId
     * @return
     */
    public int updateArticleNumber(long articleId);
    
    /**
     * 通过选择条件查找分页article
     *
     * @param lang
     * @param projectId
     * @param columnId
     * @param pageIndex
     * @param pageSize
     * @return
     */
    public List<ArticleDetailVo> selectByArticleColumnId(String lang, String projectId, long columnId, int pageIndex, int pageSize);
    
    /**
     * 今日推荐查找
     *
     * @param lang
     * @param projectId
     * @param columnId
     * @param pageIndex
     * @param pageSize
     * @param exceptIdList
     * @return
     */
    public List<ArticleDetailVo> selectByArticleColumnIdFirst(String lang, String projectId, long columnId, int pageIndex, int pageSize, List<Long> exceptIdList);
    
    /**
     * 查找热门文章
     *
     * @param lang
     * @param projectId
     * @return
     */
    public List<ArticleDetailVo> selectHotArticle(String lang, String projectId);
    
    
    /**
     * 查看今日推荐
     *
     * @param lang
     * @param projectId
     * @return
     */
    public List<ArticleDetailVo> selectTodayArticle(String lang, String projectId);
    
    /**
     * 通过columnid projectId进行查找
     *
     * @param lang
     * @param projectId
     * @param columnId
     * @return
     */
    public List<ArticleDetailVo> selectArticleByColumnId(String lang, String projectId, long columnId);
    
    /**
     * 每一类的文章数量
     *
     * @param columnId
     * @return
     */
    public int countArticleByColumn(String appNumber,long columnId);


    /**
     * 更新热门文章缓存
     * @param lang
     * @param projectId
     * @return
     */
    public List<HotArticleCachePo> updateHotArticleCachePo(String lang,String projectId);

    /**
     * 更新今日推荐缓存
     * @param lang
     * @param projectId
     * @return
     */
    public ArticleTotalityInfoVo updateArticleTotalityInfo(String lang, String projectId);

    /**
     * 更新今日缓存
     * @param lang
     * @param projectId
     * @return
     */
    public List<TodayArticleCachePo> updateTodayArticleCachePo(String lang ,String projectId);


    /**
     * 更新article的收藏数量 阅读数量 点赞数量
     * @return
     */
    int updateArticleMock(ArticleMockParam articleMockParam);
}
